<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2023-01-30 11:36:14
 * @Last Modified time: 2023-01-31 19:08:35
 */
namespace app\api\controller;
use think\App;
use frank\base\BaseController;
use frank\exception\CommonException;
/**
 * 控制器基础类
 */
class Base extends BaseController
{ 	

    /**
     * 当前登陆用户信息
     * @var
     */
    protected $user;

    /**
     * 当前登陆用户ID
     * @var
     */
    protected $uid;

    // 初始化
    protected function initialize()
    {
        if($this->request->isLogin()){
            $this->uid = $this->request->uid() ?? 0;
            $this->user = $this->request->user() ?? [];
        }
    }
}